<?php
/**
 * <https://y.st./>
 * Copyright © 2015 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'title' => 'The discovery of <code>minetest.register_biome()</code>',
	'body' => <<<END
</p>
	Early this morning, I set out to verify that PayPal is still giving me trouble and refusing to allow me to use their service.
	The plan was to hassle Bandcamp about it to try to get them to accept another form of payment.
	However, for some odd reason, PayPal accepted the payment from me.
	However tonight, PayPal has stopped accepting payments from me again, so I cannot buy the second album I was planning on buying.
	I think I will hassle PayPal (instead of Bandcamp) about it.
	I tried to reach PayPal support through their website, but as was the case last time I had issues with PayPal, they hide their contact information in an attempt to make those who would complain go away.
	As before, I&apos;ve had to <a href="https://twitter.com/YstDomain/status/579870230886895616">take this publicly to Twitter</a> as I can&apos;t find another way to reach PayPal support.
</p>
</p>
	In any case, I&apos;m now the proud owner of a copy of Marc with a C&apos;s album <a href="https://marcwithac.bandcamp.com/album/an-introduction-to-marc-with-a-c">An Introduction To Marc With a C</a>.
	I bought the album to listen to &quot;Love My Little Squiddy&quot;, but almost every song on the album is awesome.
	&quot;Drunk Classic Rock Fans&quot; is probably my favorite on the album.
	I hope to get the PayPal situation sorted out in a timely manor though, so I can get &quot;I Will Repossess Your Heart&quot; and the rest of <a href="https://marcwithac.bandcamp.com/album/losing-salt">Losing Salt</a>.
</p>
</p>
	I took a look at the output of $a[PHP]&apos;s <code>highlight_string()</code> function to see what I could do with it.
	I didn&apos;t get far.
	Things looked promising at first, but then I noticed that neither type of quotation mark was being encoded for use on a Web page.
	I thought it would cause substring replacement issues, but now as I type this, I think I realize I was wrong.
	I will again try to tackle the issue tomorrow.
</p>
</p>
	After hitting a dead end with <code>highlight_string()</code>, I shut down Eschalot, which had been running on my server, and started up the Minetest server software.
	The current world served is just a test world, and the plan was that it would become corrupted as I slowly twisted minetest_game into minetyst_game.
	Once minetyst_game became presentable, I would delete the served world entirely and start anew with a more permanent world.
	I even added warnings of such in the server description and message of the day.
	However, once I started looking through the minetest_game code to start cleaning it up, I quickly chanced upon a function not listed in the <a href="https://github.com/minetest/minetest/blob/master/doc/lua_api.txt">Minetest $a[API] documentation</a>: <code>minetest.register_biome()</code>.
	It seems this function defines the biomes for use in the v7 map generator, as well as probably in the v5 map generator.
	Only one biome is defined in minetest_game, but through experimenting, I found I can definitely get a second biome defined.
	The problem, however, is that I have no clue what I&apos;m doing as I have no documentation to work with.
	<code>minetest.register_biome()</code> takes a single argument, a table containing entries labeled with particular keys.
	Most of the functionality of these keys can be figured out by just playing with the function and generating worlds, but <code>y_min</code>, <code>y_max</code>, <code>heat_point</code>, and <code>humidity_point</code> still confuse me.
	I would think that <code>y_min</code> and <code>y_max</code> would define the hight of the biome, but this isn&apos;t the case.
	Despite <code>y_min</code> being set to -32000, the biomes only extend down to -32, at which point mapgen_stone takes over.
	<code>heat_point</code> and <code>humidity_point</code> are no doubt used to decide which biomes are placed where, but they are single integers, not ranges, and I have no idea what happens when the heat and humidity noise conflict on what biome should go where.
	For example, I set a desert biome to have higher heat and lower humidity than the default biome.
	So what happens if an area has higher heat and higher humidity? Or lower heat and lower humidity? Which biome is placed there in these cases? In any case, if I can figure out how this function works, I should be able to set the map up to be exactly as I want it.
	All the other tricky biome stuff is easily accomplished using <code>minetest.register_decoration()</code>.
</p>
</p>
	PayPal is giving me grief, but the $a[NSA] and $a[FBI] currently aren&apos;t.
	My <a href="/a/canary.txt">canary</a> still sings and I may still speak freely today.
</p>
END
);
